package model;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import utility.PriceFormater;

/**
 *
 * @author Malene
 */
public class Event {

    private final int id;
    private final Calendar dato;
    private final int antalBestilt;
    private int antalFremmødte;
    private final String sted;
    private final String kundeTlf;
    private final EventType eventType;

    public Event(int id, Calendar dato, int antalBestilt, int antalFremmødte, String sted, String kundeTlf, EventType eventType) {
        this.id = id;
        this.dato = dato;
        this.antalBestilt = antalBestilt;
        this.antalFremmødte = antalFremmødte;
        this.sted = sted;
        this.kundeTlf = kundeTlf;
        this.eventType = eventType;
    }

    public int getId() {
        return id;
    }

    public Calendar getDato() {
        return dato;
    }

    public int getAntalBestilt() {
        return antalBestilt;
    }

    public int getAntalFremmødte() {
        return antalFremmødte;
    }

    public void setAntalFremmødte(int antalFremmødte) {
        this.antalFremmødte = antalFremmødte;
    }

    public String getSted() {
        return sted;
    }

    public String getKundeTlf() {
        return kundeTlf;
    }

    public EventType getEventType() {
        return eventType;
    }

    public String toDatoString() {
        SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy-HH:mm");
        return sdf.format(dato.getTime());
    }

    @Override
    public String toString() {
        String result = eventType + " d. " + toDatoString() + "  KundeTlfnr: " + kundeTlf;
        return result;
    }

    public String toVisEventString() {
        String result = "Dato: " + toDatoString() + "\nKundeTlfnr: " + kundeTlf + "\nEventtype: " + eventType + "\nSted: " + sted + "\nAntal bestilte billetter: "
                + antalBestilt + "\nPris i DKK: " + PriceFormater.formaterPrisTilString(eventType.getPrisDKK()) + " Kr." + "\nPris i EURO: " + PriceFormater.formaterPrisTilString(eventType.getPrisEURO()) + " €";
        return result;
    }
}
